package com.example.shengyin.service;

import com.example.shengyin.dao.EventMapper;
import com.example.shengyin.entity.Event;
import com.example.shengyin.entity.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class EvenService {


    @Autowired
    private EventMapper dao;

    public Event selectById(int id) {return dao.selectById(id);}
    public int add(Event event)
    {
        return dao.add(event);
    }
    public int update(Event event)
    {
        return dao.update(event);
    }
    public int delByIds(String ids)
    {
        return dao.delByIds(ids);
    }
    public int delById(int id)
    {
        return dao.delById(id);
    }
    public Page selectList(String title, int pageNo, int pageSize) {
        List<Event> list = dao.selectList(title,pageNo,pageSize);
        int total=dao.fand(title);
        return new Page(list,pageNo,total,pageSize);
    }
    public List<Event> frontSelect(String res, String stype, String addr, int pageNo, int pageSize){
        List<Event> list = dao.frontSelect(res,stype,addr,pageNo,pageSize);
        return list;
    }

    public int fand(String title) {
        return dao.fand(title);
    }



}
